package com.ternnetwork.configuration.controller.job;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ternnetwork.commons.model.http.BaseResponse;
import com.ternnetwork.configuration.entity.job.QuartzJobTrigger;
import com.ternnetwork.configuration.service.job.QuartzJobTriggerService;

@Controller@Scope("prototype")
@RequestMapping("/configuration/job/trigger/*")
public class QuartzJobTriggerController {
	
	
	@Resource
	private QuartzJobTriggerService quartzJobTriggerService;
	
	
	@RequestMapping("add.htm")
	public @ResponseBody BaseResponse addQuartzJobTrigger(QuartzJobTrigger t) throws Exception{
		return quartzJobTriggerService.idoAdd(t);
	}
	
	@RequestMapping("update.htm")
	public @ResponseBody BaseResponse updateQuartzJobTrigger(QuartzJobTrigger t) throws Exception{
		return quartzJobTriggerService.idoUpdate(t);
	}
	
	@RequestMapping("delete.htm")
	public @ResponseBody BaseResponse deleteQuartzJobTrigger(Long id) throws Exception{
		return quartzJobTriggerService.idoDelete(id);
	}
	
}
